html,
body {
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    font: 16px/1.5 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fb;
    color: #202c3a;
}

.header {
    margin: 24px;
    padding: 12px;
    border-radius: 12px;
    background: #ffffff;
    color: #6c7b8c;
    box-shadow: 0 6px 24px rgba(35, 54, 89, 0.08);
    text-align: center;
}

.header svg {
    height: 48px;
}

.content {
    flex-grow: 1;
}

.content_i {
    margin: 0 auto;
    padding: 32px;
    width: min(1200px, 100%);
}

.content a {
    color: #1367d6;
    text-decoration: none;
}

.content a:hover {
    text-decoration: underline;
}

.footer {
    border-top: 1px solid #d8dfea;
    margin: 24px 24px 0;
    padding: 24px;
    text-align: center;
    color: #6c7b8c;
    font-size: 14px;
}

.footer a {
    color: inherit;
}

.footer_icons {
    padding-top: 16px;
    display: flex;
    justify-content: center;
}

.footer_icons a {
    margin: 0 12px;
}

.footer_icons svg {
    height: 32px;
    fill: #6c7b8c;
    transition: fill 0.2s ease-in-out;
}

.footer_icons a:hover svg {
    fill: #1367d6;
}

.text-center {
    text-align: center;
}

/* Home page */
.page {
    display: grid;
    gap: 32px;
}

.hero {
    padding: 32px;
    background: linear-gradient(145deg, #1f75fe 0%, #42a7ff 100%);
    color: #ffffff;
    border-radius: 18px;
    box-shadow: 0 10px 32px rgba(19, 103, 214, 0.3);
}

.hero h1 {
    margin: 0 0 8px;
    font-size: 32px;
    font-weight: 700;
}

.hero p {
    margin: 0 0 20px;
    font-size: 18px;
    max-width: 640px;
}

.create-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-top: 16px;
}

.create-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 240px;
}

.create-form input {
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
}

.create-form button {
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    background: #ffffff;
    color: #1367d6;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(22, 50, 92, 0.2);
    transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
}

.create-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(22, 50, 92, 0.25);
}

.webhook-list {
    background: #ffffff;
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 6px 20px rgba(35, 54, 89, 0.08);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.section-header h2 {
    margin: 0;
    font-size: 22px;
}

.section-header p {
    margin: 0;
    color: #6c7b8c;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

thead {
    color: #6c7b8c;
    text-align: left;
}

thead th {
    padding-bottom: 12px;
    border-bottom: 1px solid #e5ecf6;
    font-weight: 600;
}

tbody td {
    padding: 12px 0;
    border-bottom: 1px solid #eff3fb;
}

tbody tr:last-child td {
    border-bottom: none;
}

.primary-link {
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(19, 103, 214, 0.1);
    color: #1367d6;
    font-weight: 600;
}

.primary-link:hover {
    background: rgba(19, 103, 214, 0.18);
}

.button {
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    background: transparent;
    color: inherit;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.button:focus {
    outline: none;
}

.button-secondary {
    background: rgba(19, 103, 214, 0.1);
    color: #1367d6;
}

.button-secondary:hover {
    background: rgba(19, 103, 214, 0.18);
}

.button-danger {
    background: rgba(217, 45, 36, 0.1);
    color: #d92d24;
}

.button-danger:hover {
    background: rgba(217, 45, 36, 0.18);
}

.inline-form {
    margin: 0;
}

.actions-cell {
    display: flex;
    gap: 12px;
    align-items: center;
}

.actions-cell form {
    margin: 0;
}

.muted {
    color: #9aa7b8;
}

.empty-state {
    padding: 32px;
    text-align: center;
    color: #6c7b8c;
    background: rgba(19, 103, 214, 0.04);
    border-radius: 12px;
}

/* Webhook detail page */
.webhook-page {
    display: grid;
    gap: 32px;
}

.webhook-summary {
    background: #ffffff;
    padding: 32px;
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(42, 68, 118, 0.08);
    display: grid;
    gap: 32px;
}

.webhook-summary header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
}

.webhook-summary .summary-title {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.webhook-summary h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

.webhook-summary .token {
    margin: 6px 0 0;
    color: #516173;
    font-size: 15px;
}

.webhook-summary dl {
    display: flex;
    gap: 24px;
    margin: 0;
}

.webhook-summary .summary-meta {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.webhook-summary .summary-actions {
    display: flex;
    gap: 8px;
}

.webhook-summary dt {
    font-weight: 600;
    color: #516173;
    font-size: 14px;
}

.webhook-summary dd {
    margin: 4px 0 0;
    font-size: 15px;
}

.capture-url h2,
.response-form h2 {
    margin: 0 0 8px;
    font-size: 20px;
}

.url-block {
    display: block;
    margin: 12px 0;
    padding: 12px 16px;
    border-radius: 10px;
    background: #0f1f3a;
    color: #ffffff;
    font-size: 15px;
    overflow-wrap: anywhere;
}

.secondary {
    color: #6c7b8c;
    font-size: 14px;
}

.response-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.response-form .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.response-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: #516173;
}

.response-form input,
.response-form textarea {
    padding: 10px 12px;
    border: 1px solid #d8dfea;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.response-form input:focus,
.response-form textarea:focus {
    border-color: #1367d6;
    box-shadow: 0 0 0 3px rgba(19, 103, 214, 0.15);
    outline: none;
}

.response-form button {
    align-self: flex-start;
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    background: #1367d6;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(20, 80, 170, 0.2);
    transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
}

.response-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(20, 80, 170, 0.24);
}

.webhook-requests {
    background: #ffffff;
    padding: 24px;
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(42, 68, 118, 0.08);
}

.requests-grid {
    display: grid;
    grid-template-columns: minmax(260px, 320px) 1fr;
    gap: 24px;
}

.request-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-right: 1px solid #eef2fa;
}

.request-list li {
    border-radius: 12px;
    margin-bottom: 8px;
    transition: background 0.15s ease-in-out;
}

.request-list li:last-child {
    margin-bottom: 0;
}

.request-list li a {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 12px;
    padding: 14px 16px;
    color: inherit;
    text-decoration: none;
}

.request-list li:hover {
    background: rgba(19, 103, 214, 0.08);
}

.request-list li.active {
    background: rgba(19, 103, 214, 0.15);
    box-shadow: inset 0 0 0 1px rgba(19, 103, 214, 0.2);
}

.request-list .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(19, 103, 214, 0.15);
    font-weight: 600;
    font-size: 13px;
    color: #0f2d6b;
    text-transform: uppercase;
}

.request-list .path {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.request-list time {
    grid-column: 1 / -1;
    font-size: 13px;
    color: #6c7b8c;
}

.request-details {
    min-height: 320px;
}

.request-details article {
    background: #0f1f3a;
    color: #e3ecff;
    border-radius: 16px;
    padding: 24px;
    height: 100%;
    display: grid;
    gap: 20px;
    box-shadow: 0 10px 28px rgba(8, 21, 47, 0.35);
}

.request-details h3 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
}

.request-details section {
    display: grid;
    gap: 8px;
}

.request-details h4 {
    margin: 0;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(227, 236, 255, 0.8);
}

.request-details pre {
    margin: 0;
    padding: 12px;
    border-radius: 10px;
    background: rgba(6, 15, 34, 0.72);
    color: #9abaff;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 1024px) {
    .requests-grid {
        grid-template-columns: 1fr;
    }

    .request-list {
        border-right: none;
    }
}

@media (max-width: 768px) {
    .content_i {
        padding: 20px;
    }

    .hero {
        padding: 24px;
    }

    .webhook-summary {
        padding: 24px;
    }

    .webhook-summary header {
        flex-direction: column;
        align-items: flex-start;
    }

    .webhook-summary dl {
        flex-direction: column;
    }

    .webhook-summary .summary-meta {
        align-items: flex-start;
        flex-direction: column;
    }

    .actions-cell {
        flex-direction: column;
        align-items: flex-start;
    }
}
